package collection;
/**Collection():
 * 1.boolean contains(Object o)    ...是否包含
 * 2. remove(Object o)             ...删除
 */
import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo2 {
    public static void main(String[] args) {
        Collection c= new ArrayList();
        c.add(new Point(1,2));
        c.add(new Point(3,4));
        c.add(new Point(5,6));
        c.add(new Point(7,8));
        System.out.println(c);//[(1,2),(3,4),(5,6)(7,8),(1,2)]

        Point p=new Point(1,2);
        boolean contains=c.contains(p);//判断c是否包含p的equals()
        System.out.println(contains);//true

        c.remove(p);//删除c中包含p的equals()
        System.out.println(c);//[(3,4),(5,6)(7,8),(1,2)]
    }
}
